<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="coinfaces">

        <title>语言特性参考</title>

    <link rel="stylesheet" href="../../../theme/css/style.css">
    <link rel="stylesheet" href="../../../theme/css/pygments.css">



</head>

<body>
    <div class="content">
<h1>语言特性参考</h1>
    <div class="section" id="truthy-value-falsy-value">
<h2>真值（truthy value）和假值（falsy value）</h2>
<p>将真值（假值）转化为布尔值得到“真”（“假”），或者将其直接用于条件判断和“真”（“假”）等价。</p>
<div class="section" id="javascript">
<h3>JavaScript</h3>
<p>假值包括 <tt class="docutils literal">false</tt> ， <tt class="docutils literal">null</tt> ， <tt class="docutils literal">undefined</tt> ， <tt class="docutils literal">NaN</tt> ， <tt class="docutils literal">0</tt> 和空字符串 <tt class="docutils literal">&quot;&quot;</tt> 。</p>
<p>对象是真值，因此空对象 <tt class="docutils literal">{}</tt> 和空列表 <tt class="docutils literal">[]</tt> 是真值。</p>
</div>
</div>

    </div>
<nav class="nav sidebar">
    <div class="siteinfo">
        <div class="sitename"><a href="../../..">coinfaces</a></div>
        <div class="tagline">Another Side of Life</div>
    </div>

            <a href="../../../pages/doc/">&larr; 文档</a>

</nav><footer class="footer">
    <span>
        &copy; jpli &middot;
        under <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA 4.0</a>
    </span>
    |
    <span>
        Powered by:
        <a href="http://blog.getpelican.com/">Pelican</a>
    </span>
</footer></body>
</html>